package com.study.system.test;

import com.study.model.system.SysRole;
import com.study.system.mapper.SysRoleMapper;
import com.study.system.service.AsyncLoginLogService;
import com.study.system.service.SysRoleService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

@SpringBootTest
public class test {

    @Autowired
    private SysRoleMapper roleMapper;

    @Autowired
    private SysRoleService sysRoleService;

    @Test
    public void test1(){
        List<SysRole> sysRoles = roleMapper.selectList(null);
        for (int i = 0; i < sysRoles.size(); i++) {
            System.out.println(sysRoles.get(i));
        }
    }

    @Test
    public void test2(){
        List<SysRole> list = sysRoleService.list();
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
    }

    @Autowired
    private AsyncLoginLogService asyncLoginLogService;

    @Test
    public void test3(){
        System.out.println(asyncLoginLogService);
        asyncLoginLogService.recordLoginLog("test",1,"test","test");
    }

}
